//
//  UIButton-Extension.swift
//  ImageBrowse
//
//  Created by zs on 16/6/19.
//  Copyright © 2016年 zs. All rights reserved.
//

import UIKit

extension UIButton {
  
    class func createBtn(title : String,bgcolor : UIColor, fontSize : CGFloat) -> UIButton{
      
        let btn = UIButton()
        
        btn.setTitle(title, forState: .Normal)
        btn.backgroundColor = bgcolor
        btn.titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        
        return btn
    
    }
    
    convenience init(title : String, bgColor : UIColor, fontSize : CGFloat) {
        self.init()
        
        setTitle(title, forState: .Normal)
        backgroundColor = bgColor
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
   
}